package com.ffapp.demo.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class NewsListBean extends BaseListBeanXF {

    private ArrayList<NewsListData> list = new ArrayList<NewsListData>();

    public ArrayList<NewsListData> getList() {
        return list;
    }

    public void setList(ArrayList<NewsListData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(NewsListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrent_page() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<NewsListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public ArrayList<String> getListStr(){
        ArrayList<String> liststr = new ArrayList<>();
        for(NewsListData listData:list){
            liststr.add(listData.getTitle());
        }
        return liststr;
    }


}
